
#ifndef  __LIBRGA_H__
#define  __LIBRGA_H__

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <dirent.h>
#include <string.h>
#include <unistd.h>
#include <memory.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <signal.h>
#include <fcntl.h>
#include <pthread.h>

#include "debug.h"

#include "rga.h"
#include "RgaApi.h"
#include "im2d.h"



#define ERROR               -1

#define SRC_WIDTH  1280
#define SRC_HEIGHT 720

#define DST_WIDTH  1280
#define DST_HEIGHT 720

#define DST_FORMAT RK_FORMAT_RGBA_8888


//RK_FORMAT_RGBA_8888    = 0x0 << 8,

#define SRC_FORMAT 		 (0x0 << 8)


typedef enum _mode_code {
    MODE_QUERYSTRING = 0,
    MODE_COPY,
    MODE_RESIZE,
    MODE_CROP,
    MODE_ROTATE,
    MODE_FLIP,
    MODE_TRANSLATE,
    MODE_BLEND,
    MODE_CVTCOLOR,
    MODE_FILL,
    MODE_WHILE,
    MODE_NONE,
    MODE_MAX
} MODE_CODE;

#define MODE_QUERYSTRING_CHAR     (char) (MODE_QUERYSTRING+'0')
#define MODE_COPY_CHAR            (char) (MODE_COPY       +'0')
#define MODE_RESIZE_CHAR          (char) (MODE_RESIZE     +'0')
#define MODE_CROP_CHAR            (char) (MODE_CROP       +'0')
#define MODE_ROTATE_CHAR          (char) (MODE_ROTATE     +'0')
#define MODE_FLIP_CHAR            (char) (MODE_FLIP       +'0')
#define MODE_TRANSLATE_CHAR       (char) (MODE_TRANSLATE  +'0')
#define MODE_BLEND_CHAR           (char) (MODE_BLEND      +'0')
#define MODE_CVTCOLOR_CHAR        (char) (MODE_CVTCOLOR   +'0')
#define MODE_FILL_CHAR            (char) (MODE_FILL       +'0')
#define MODE_NONE_CHAR            (char) (MODE_NONE       +'0')

#define BLUE_COLOR  0xffff0000
#define GREEN_COLOR 0xff00ff00
#define RED_COLOR   0xff0000ff
#define WHILE_FLAG  (1 << 7)

struct format_table_entry {
    int format;
    const char *name;
};


int rga_control(int cmd1 ,int cmd2);
int rga_control2(int cmd1 ,char * in_buff, int in_w,int in_h ,int in_bpp,
							char* out_buff,int out_w,int out_h,int out_bpp);


#endif



